<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>首页</title>
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/css/quoted.css">
    <script src="/js/jquery-1.8.3.min.js"></script>
    <script src="/js/qrcode.js"></script>
</head>
<body>
    <header class="header">
        <div class="header-top">
            <div class="header-top__wrap">
                <div class="logo"><img src="/img/logo.png"></div>
                <div class="logo-txt"><img src="/img/logo-txt.png"></div>
                <div class="contact">
                    <p class="name">咨询热线：</p>
                    <p class="phone">400-026-2021</p>
                </div>
            </div>
        </div>
        <div class="header-menu">
            <div class="header-menu__wrap">
                <div class="header-menu__list">
                    <div class="header-menu__list-cell">
                        <a href="/index.html">首页</a>
                    </div>
                    <div class="header-menu__list-cell">
                        <a href="/desc.html">产品介绍</a>
                    </div>
                    <div class="header-menu__list-cell active">
                        <a>产品报价</a>
                        <div class="menu-fixed">
                            <div class="menu-fixed-list">
                                <a href="/quoted_transparent.html" class="menu-fixed-list-cell">透明膜</a>
                                <a href="/quoted_color.html" class="menu-fixed-list-cell">改色膜</a>
                                <a href="/quoted_sun.html" class="menu-fixed-list-cell">太阳膜</a>
                            </div>
                        </div>
                    </div>
                    <div class="header-menu__list-cell">
                        <a href="/example.html">案例展示</a>
                    </div>
                    <div class="header-menu__list-cell">
                        <a href="/service_login.html">服务商</a>
                    </div>
                    <div class="header-menu__list-cell">
                        <a href="/quailty.html">质保查询</a>
                    </div>
                </div>
            </div>
        </div>
    </header>
    <div class="quoted">
        <div class="pageNav">
            <a href="/index.html">首页</a>
            <span class="icon">&gt;</span>
            <span class="current">产品报价</span>
        </div>
        <div class="select">
            <div class="select-cell" onclick="toggleModalList()">产品系列<span class="icon">&gt</span></div>
            <div class="select-cell" onclick="toggleModalBrand()">汽车品牌<span class="icon">&gt</span></div>
        </div>
        <div class="content">
            <div class="left" id="left" style="display: inline-block;">
                <div class="icon-top">&gt;</div>
                <div class="icon-bottom">&gt;</div>
                <div class="list" id="part-price">
                    <div class="list-wrap">
                        <div class="list-wrap__content">
                            <div class="btn-cell" value="5760" onclick="selectCarPart(this)" name="whole">
                                <div class="icon"><img src="/img/quoted/transparent/icon-whole.png"></div>
                                <span>整车</span>
                            </div>
                            <div class="btn-cell" value="1" onclick="selectCarPart(this)" name="cheding">
                                <div class="icon"><img src="/img/quoted/transparent/icon-cheding.png"></div>
                                <span>车顶</span>
                            </div>
                            <div class="btn-cell" value="2" onclick="selectCarPart(this)" name="hougai">
                                <div class="icon"><img src="/img/quoted/transparent/icon-hougai.png"></div>
                                <span>后盖</span>
                            </div>
                            <div class="btn-cell" value="3" onclick="selectCarPart(this)" name="hougang">
                                <div class="icon"><img src="/img/quoted/transparent/icon-hougang.png"></div>
                                <span>后杠</span>
                            </div>
                            <div class="btn-cell" value="4" onclick="selectCarPart(this)" name="houshijing">
                                <div class="icon"><img src="/img/quoted/transparent/icon-houshijing.png"></div>
                                <span>后视镜</span>
                            </div>
                            <div class="btn-cell" value="5" onclick="selectCarPart(this)" name="jigai">
                                <div class="icon"><img src="/img/quoted/transparent/icon-jigai.png"></div>
                                <span>机盖</span>
                            </div>
                            <div class="btn-cell" value="6" onclick="selectCarPart(this)" name="qiangang">
                                <div class="icon"><img src="/img/quoted/transparent/icon-qiangang.png"></div>
                                <span>前杠</span>
                            </div>
                            <div class="btn-cell" value="7" onclick="selectCarPart(this)" name="youcequn">
                                <div class="icon"><img src="/img/quoted/transparent/icon-youcequn.png"></div>
                                <span>右侧裙</span>
                            </div>
                            <div class="btn-cell" value="8" onclick="selectCarPart(this)" name="youhouyezi">
                                <div class="icon"><img src="/img/quoted/transparent/icon-youhouyezi.png"></div>
                                <span>右后叶子板</span>
                            </div>
                            <div class="btn-cell" value="9" onclick="selectCarPart(this)" name="youmenzuhe">
                                <div class="icon"><img src="/img/quoted/transparent/icon-youmenzuhe.png"></div>
                                <span>右门组合</span>
                            </div>
                            <div class="btn-cell" value="10" onclick="selectCarPart(this)" name="youqianyezi">
                                <div class="icon"><img src="/img/quoted/transparent/icon-youqianyezi.png"></div>
                                <span>右前叶子板</span>
                            </div>
                            <div class="btn-cell" value="11" onclick="selectCarPart(this)" name="zuocequn">
                                <div class="icon"><img src="/img/quoted/transparent/icon-zuocequn.png"></div>
                                <span>左侧裙</span>
                            </div>
                            <div class="btn-cell" value="12" onclick="selectCarPart(this)" name="zuohouyezi">
                                <div class="icon"><img src="/img/quoted/transparent/icon-zuohouyezi.png"></div>
                                <span>左后叶子板</span>
                            </div>
                            <div class="btn-cell" value="13" onclick="selectCarPart(this)" name="zuomenzuhe">
                                <div class="icon"><img src="/img/quoted/transparent/icon-zuomenzuhe.png"></div>
                                <span>左门组合</span>
                            </div>
                            <div class="btn-cell" value="14" onclick="selectCarPart(this)" name="zuoqianyezi">
                                <div class="icon"><img src="/img/quoted/transparent/icon-zuoqianyezi.png"></div>
                                <span>左前叶子板</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="middle">
                <div class="car-name">宝马 X4</div>
                <div class="car-brand">透明膜<span style="margin: 0 10px;">|</span>三摩Q系列</div>
                <div class="car" id="car">
                    <div class="car-part-whole" id="whole">
                        <img src="/img/quoted/transparent/whole.png">
                    </div>
                    <div class="car-part" id="cheding" style="display: none;">
                        <img src="/img/quoted/transparent/cheding.png">
                    </div>
                    <div class="car-part" id="hougai" style="display: none;">
                        <img src="/img/quoted/transparent/hougai.png">
                    </div>
                    <div class="car-part" id="hougang" style="display: none;">
                        <img src="/img/quoted/transparent/hougang.png">
                    </div>
                    <div class="car-part" id="houshijing" style="display: none;">
                        <img src="/img/quoted/transparent/houshijing.png">
                    </div>
                    <div class="car-part" id="jigai" style="display: none;">
                        <img src="/img/quoted/transparent/jigai.png">
                    </div>
                    <div class="car-part" id="qiangang" style="display: none;">
                        <img src="/img/quoted/transparent/qiangang.png">
                    </div>
                    <div class="car-part" id="youcequn" style="display: none;">
                        <img src="/img/quoted/transparent/youcequn.png">
                    </div>
                    <div class="car-part" id="youhouyezi" style="display: none;">
                        <img src="/img/quoted/transparent/youhouyezi.png">
                    </div>
                    <div class="car-part" id="youmenzuhe" style="display: none;">
                        <img src="/img/quoted/transparent/youmenzuhe.png">
                    </div>
                    <div class="car-part" id="youqianyezi" style="display: none;">
                        <img src="/img/quoted/transparent/youqianyezi.png">
                    </div>
                    <div class="car-part" id="zuocequn" style="display: none;">
                        <img src="/img/quoted/transparent/zuocequn.png">
                    </div>
                    <div class="car-part" id="zuohouyezi" style="display: none;">
                        <img src="/img/quoted/transparent/zuohouyezi.png">
                    </div>
                    <div class="car-part" id="zuomenzuhe" style="display: none;">
                        <img src="/img/quoted/transparent/zuomenzuhe.png">
                    </div>
                    <div class="car-part" id="zuoqianyezi" style="display: none;">
                        <img src="/img/quoted/transparent/zuoqianyezi.png">
                    </div>
                </div>
            </div>
            <div class="right" id="right" style="display: inline-block;">
                <div class="price-detail" id="price-detail">
                    <div class="title">报价详情</div>
                    <div class="list">
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-cheding" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-cheding.png"></div>
                            <div class="text">
                                <p class="part-name">车顶</p>
                                <p class="money">￥1</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-hougai" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-hougai.png"></div>
                            <div class="text">
                                <p class="part-name">后盖</p>
                                <p class="money">￥2</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-hougang" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-hougang.png"></div>
                            <div class="text">
                                <p class="part-name">后杠</p>
                                <p class="money">￥3</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-houshijing" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-houshijing.png"></div>
                            <div class="text">
                                <p class="part-name">后视镜</p>
                                <p class="money">￥4</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-jigai" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-jigai.png"></div>
                            <div class="text">
                                <p class="part-name">机盖</p>
                                <p class="money">￥5</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-qiangang" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-qiangang.png"></div>
                            <div class="text">
                                <p class="part-name">前杠</p>
                                <p class="money">￥6</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-youcequn" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-youcequn.png"></div>
                            <div class="text">
                                <p class="part-name">右侧裙</p>
                                <p class="money">￥7</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-youhouyezi" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-youhouyezi.png"></div>
                            <div class="text">
                                <p class="part-name">右后叶子板</p>
                                <p class="money">￥8</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-youmenzuhe" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-youmenzuhe.png"></div>
                            <div class="text">
                                <p class="part-name">左门组合</p>
                                <p class="money">￥9</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-youqianyezi" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-youqianyezi.png"></div>
                            <div class="text">
                                <p class="part-name">右前叶子板</p>
                                <p class="money">￥10</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-zuocequn" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-zuocequn.png"></div>
                            <div class="text">
                                <p class="part-name">左侧裙</p>
                                <p class="money">￥11</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-zuohouyezi" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-zuohouyezi.png"></div>
                            <div class="text">
                                <p class="part-name">左后叶子板</p>
                                <p class="money">￥12</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-zuomenzuhe" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-zuomenzuhe.png"></div>
                            <div class="text">
                                <p class="part-name">左门组合</p>
                                <p class="money">￥13</p>
                            </div>
                        </div>
                        <div class="detail-cell" onclick="selectCarPart(this)" id="detail-zuoqianyezi" style="display: none;">
                            <div class="icon"><img src="/img/quoted/transparent/icon-zuoqianyezi.png"></div>
                            <div class="text">
                                <p class="part-name">左前叶子板</p>
                                <p class="money">￥14</p>
                            </div>
                        </div>
                    </div>
                    <div class="total-right">总计： ￥ <span id="total-money-right">0</span></div>
                </div>
            </div>
            <div class="total">
                <div class="total-content">
                    总价：
                    <span class="mark">￥</span>
                    <span class="num" id="total-money">0</span>
                </div>
            </div>
        </div>
        <!-- 产品系列 -->
        <div class="modal-list" id="modal-list" style="display: none;">
            <div class="modal-wrap">
                <div class="name">
                    <div class="sub">
                        <a class="sub-name" onclick="toggleModalList()">三摩MAT系列</a>
                        <a class="sub-name" onclick="toggleModalList()">三摩Q系列</a>
                        <a class="sub-name" onclick="toggleModalList()">三摩H系列</a>
                    </div>
                </div>
            </div>
        </div>
        <!-- 汽车品牌 -->
        <div class="modal-brand" id="modal-brand" style="display: none;">
            <div class="modal-wrap">
                <div class="modal-wrap__content">
                    <div class="title">选择汽车品牌</div>
                    <div class="modal-content-left">
                        <div class="cars">
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name active">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                            <a class="name">保时捷</a>
                        </div>
                    </div>
                    <div class="modal-content-right">
                        <div class="icon"><img src="/img/example/icon.png"></div>
                        <div class="brand" id="brand">
                            <a class="name">保时捷</a>
                            <a class="name">英菲尼迪 </a>
                            <a class="name">路虎</a>
                            <a class="name active">奔驰</a>
                            <a class="name">斯柯达</a>
                            <a class="name">雷克萨斯 </a>
                            <a class="name">保时捷</a>
                            <a class="name">英菲尼迪 </a>
                            <a class="name">路虎</a>
                            <a class="name">奔驰</a>
                            <a class="name">斯柯达</a>
                            <a class="name">雷克萨斯 </a>
                            <a class="name">保时捷</a>
                            <a class="name">英菲尼迪 </a>
                            <a class="name">路虎</a>
                            <a class="name">奔驰</a>
                            <a class="name">斯柯达</a>
                            <a class="name">雷克萨斯 </a>
                            <a class="name">保时捷</a>
                            <a class="name">英菲尼迪 </a>
                            <a class="name">路虎</a>
                            <a class="name">奔驰</a>
                        </div>
                        <div class="sure" onclick="sureModalBrand()">确认</div>
                    </div>
                    <div class="close" onclick="toggleModalBrand()">+</div>
                </div>
            </div>
        </div>
        <script>
            function toggleModalList() {
                var dom = document.getElementById('modal-list')
                if (dom.style.display == 'block') {
                    dom.style.display = 'none'
                } else {
                    dom.style.display = 'block'
                }
            }

            function toggleModalBrand() {
                var dom = document.getElementById('modal-brand')
                if (dom.style.display == 'block') {
                    dom.style.display = 'none'
                } else {
                    dom.style.display = 'block'
                }
            }

            function sureModalBrand() {
                toggleModalBrand()
            }

            document.getElementById('brand').addEventListener('click', function(e){
                var targetDom = e.target
                if (targetDom == this) return
                var brandName = [].slice.call(this.getElementsByClassName('name'))
                for (var index = 0; index < brandName.length; index++) {
                    var element = brandName[index];
                    element.setAttribute('class', 'name')
                }
                targetDom.setAttribute('class', 'name active')
            })
        </script>
        <script>
            // 选择车部位
            function selectCarPart(dom) {

                var carPartName = dom.getAttribute('name')
                var partBtnDoms = [].slice.call(document.getElementById('part-price').querySelectorAll('.btn-cell'))
                var carPartDoms = [].slice.call(document.getElementById('car').querySelectorAll('.car-part'))
                var detailCellDoms = [].slice.call(document.getElementById('price-detail').querySelectorAll('.detail-cell'))
                if (carPartName == 'whole') {
                    partBtnDoms.forEach(element => {
                        var domCalss = dom.getAttribute('class').split(' ')
                        domCalss = domCalss.filter(i => i !== 'active')
                        element.setAttribute('class', domCalss.join(' '))
                    })

                    carPartDoms.forEach(element => {
                        element.style.display = 'block'
                    })

                    detailCellDoms.forEach(element => {
                        element.style.display = 'block'
                    })
                } else {
                    var partBtnDoms_whole = partBtnDoms.find(i => i.getAttribute('name') == 'whole')
                    if (partBtnDoms_whole.getAttribute('class').indexOf('active') > -1) {
                        carPartDoms.forEach(element => {
                            element.style.display = 'none'
                        })
                        var classes = partBtnDoms_whole.getAttribute('class').split(' ')
                        classes = classes.filter(i => i !== 'active')
                        partBtnDoms_whole.setAttribute('class', classes.join(' '))

                        detailCellDoms.forEach(element => {
                            element.style.display = 'none'
                        })
                    }
                }

                var carPartDom = document.getElementById(dom.getAttribute('name'))
                var domCalss = dom.getAttribute('class').split(' ')
                var detailCellDom = document.getElementById('detail-' + carPartName)
                if (domCalss.indexOf('active') > -1) {
                    domCalss = domCalss.filter(i => i !== 'active')
                    carPartDom.style.display = 'none'
                    if (detailCellDom) {
                        detailCellDom.style.display = 'none'
                    }
                    
                } else {
                    domCalss.push('active')
                    carPartDom.style.display = 'block'
                    if (detailCellDom) {
                        detailCellDom.style.display = 'block'
                    }
                }
                dom.setAttribute('class', domCalss.join(' '))

                // 计算总额
                var activeDomValue = partBtnDoms.filter(i => i.getAttribute('class').indexOf('active') > -1).map(i => i.getAttribute('value') - 0)
                var totalMoney = activeDomValue.reduce((i, j) => i+j)
                document.getElementById('total-money').innerText = totalMoney
                document.getElementById('total-money-right').innerText = totalMoney
            }
       </script>
    </div>
    <footer class="footer">
        <div class="footer-wrap">
            <div class="logo-wrap">
                <div class="logo"><img src="/img/logo-w.png"></div>
                <div class="logo-txt"><img src="/img/logo-txt-w.png"></div>
            </div>
            <div class="link-wrap">
                <a href="/quoted_transparent.html" class="link"> 产品报价</a>
                <span class="line">｜</span>
                <a href="/quailty.html" class="link">质保查询</a>
                <div class="share">
                    <span>分享：</span>
                    <span id="share-weibo" class="icon"><img src="/img/icon-share-1.png"></span>
                    <span id="share-wx" class="icon"><img src="/img/icon-share-2.png"></span>
                    <span id="share-qq" class="icon"><img src="/img/icon-share-3.png"></span>
                </div>
                <p class="copyright"> Copyright © 2019-2021 三摩, All Rights Reserved </p>
            </div>
            <div class="qrcode-wrap">
                <div class="img"><img src="/img/qrcode.png" alt=""></div>
                <p>扫一扫关注微信小程序</p>
            </div>
        </div>
        <div class="qrcode-wx" id="qrcode-wx" style="display: none;">
            <div class="title"><span>分享到微信朋友圈</span></div>
            <span class="close">+</span>
            <div id="qrcode-wx-img"></div>
            <div class="tip">打开微信“扫一扫”即可分享至朋友圈</div>
        </div>
        <script src="/js/share.js"></script>
    </footer>
</body>
</html>